package com.example.springbootwl08.product.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.springbootwl08.product.pojo.dto.OrderPageDTO;
import com.example.springbootwl08.product.pojo.entity.Order;
import com.example.springbootwl08.product.pojo.entity.OrderGoods;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 宗雨
 * @create 2024-02-27 14:47
 * project_name:ssm
 * @Description
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    @Select("select * from sp_order where order_id=#{id}")
    Order getById(Integer id);

    Page<Order> selectPage(OrderPageDTO orderPageDTO);

    void updateByid(Order order);

    @Select("select * from sp_order_goods where order_id=#{orderId}")
    List<OrderGoods> getOrderGoodsById(Integer orderId);
}
